<?php
// +----------------------------------------------------------------------
// | EtrolPHP [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Author: Author: LJQ <liujiqi@etrol.com>
// +----------------------------------------------------------------------
namespace app\duty\controller;
use app\common\controller\Admin;
use app\duty\controller\api\Replay as ReplayApi;

/**
 * 记录回放
 * @package app\Replay
 */
class Replay  extends Admin

{

    protected $api;

    public function _initialize()
    {
        parent::_initialize();
        $this->api = new ReplayApi();

    }
    /**
     * 首页
     *
     */
    public function index() {
        $info=model('duty/events')->where(array('eventType'=>'2'))->column('title','id');
        $this->assign('info',$info);
        return $this->fetch();
    }


    public function detail($eventId){
        $title=model('duty/events')->where(array('id'=>$eventId))->value('title');
        $this->assign('title',$title);

        $this->assign('eventId',$eventId);


        return $this->fetch();


    }

    public function  file($eventId=null){

    	$filelist = $this->api->filelist($eventId);
        return $filelist;

    }

    public function  camera(){

        return $this->fetch();
    }


    public function  video($eventId=null){

        $videolist=$this->api->videolist($eventId);
        return $videolist;

    }


    public function  photo($eventId=null){

        $photolist=$this->api->photolist($eventId);
        return $photolist;

    }


    public  function searchFile($eventId=null,$start=null,$end=null,$keyword=null){
        if(IS_AJAX){
            $recordList = $this->api->search(input('start'),input('end'),input('keyword'));
            return $recordList;
        }


    }

    public  function searchVideo($eventId=null,$start=null,$end=null,$keyword=null){

        if(IS_AJAX){
            $recordList = $this->api->search(input('start'),input('end'),input('keyword'));
            return $recordList;
        }

    }


    public  function searchPhoto($eventId=null,$start=null,$end=null,$keyword=null){
        if(IS_AJAX){
            $recordList = $this->api->search(input('start'),input('end'),input('keyword'));
            return $recordList;
        }
 }













}



